home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-24 | 2.8 KB | 93 lines | [TEXT/KAHL] |
- /******************************************************************************
- CAMArrayPane.c
-
-
- SUPERCLASS = CAMTable
-
- Copyright © 1991 Bowers Development Corporation. All rights reserved.
-
- ******************************************************************************/
-
- #include "CAMArrayPane.h"
- #include <TBUtilities.h>
-
- /******************************************************************************
- IViewTemp
-
- Initialize an AM Array Pane using a template
- ******************************************************************************/
- void CAMArrayPane::IViewTemp (CView *anEnclosure,
- CBureaucrat *aSupervisor,
- Ptr viewData)
- {
- register AMArrayPaneTempP p;
-
- p = (AMArrayPaneTempP) viewData;
- theTypeStyleP = &p->typeStyle;
- inherited::IViewTemp (anEnclosure, aSupervisor, (Ptr)&p->sTableTemp);
- theTypeStyleP = nil;
-
- } /* IViewTemp */
-
- /******************************************************************************
- CreateTextEnvironment {OVERRIDE}
-
- Create and initialize the text environment used for drawing text.
- Read the info from the saved style ptr.
- ******************************************************************************/
- void CAMArrayPane::CreateTextEnvironment (void)
- {
- AMSetupTextEnvirons (this, &theTypeStyleP->editStyles);
-
- } /* CreateTextEnvironment */
-
- /******************************************************************************
- HasSelection
-
- Returns a boolean to indicate whether anything is selected.
- ******************************************************************************/
- Boolean CAMArrayPane::HasSelection (void)
- {
- return (!EmptyRgn (GetSelection ()));
-
- } /* HasSelection */
-
- /******************************************************************************
- GetChoice
-
- This is a wrapper routine for the very common kind of list which
- has a single column and allows only one item to be selected.
- Returns in its parameter the row (0..N) of the selected item.
- Returns as function result whether anything is selected.
- ******************************************************************************/
- Boolean CAMArrayPane::GetChoice (short *choice)
- {
- Cell aCell;
-
- SetPt (&aCell, 0, 0);
- if (GetSelect (TRUE, &aCell)) {
- *choice = aCell.v;
- return (TRUE);
- } else {
- *choice = -1;
- return (FALSE);
- }
-
- } /* GetChoice */
-
- /******************************************************************************
- SetChoice
-
- This is a wrapper routine for the very common kind of list which
- has a single column and allows only one item to be selected.
- Selects the cell in the specified row.
- ******************************************************************************/
- void CAMArrayPane::SetChoice (short choice)
- {
- Cell aCell;
-
- SetPt (&aCell, 0, choice);
- SelectCell (aCell, FALSE /*keepPrevious*/, TRUE /*reDraw*/);
-
- } /* SetChoice */
-